Nonvolatile memory NAND flash has been universally applied to mobile storage devices, for example, U disk, SD card, Solid State Disk and so on. The NAND flash can erase and program in memory unit block named Block. The write operation of any NAND flash device can only be performed in empty units or units erased to be empty, in order to guarantee the correctness of writing data, the erase operation must be executed before the write operation.
By now, when a segment of data needs to be written in the conventional file system based on NAND flash storage media, firstly, the system files should be modified frequently, for example, if a file is to be written in the FAT file system of the universally used Microsoft operation system, the FAT table and FDT table must be modified, and the modification should be performed multiple times before the content data of the file can be written in. Because of the intrinsic features of the NAND flash, a page in the Block cannot be reprogrammed before the whole Block is erased, however, valid data of the Block must be stored in new address (an empty Block) if the Block is to be erased.
FIG. 1 is a flow chart of an operating process of data writing of a NAND flash provided by the conventional technology, assuming that Block 1 and Block 2 are both Blocks of standard size in NAND flash, wherein Block 1 is a storage area with data and Block 2 is an empty area. If a data segment A (whose size is not bigger than that of a Block) needs to be written in a logic address zone A (the size of zone A is equal to the size of the data segment A), in the conventional NAND flash IC, while writing data from the start logic address of zone A, the operating process includes:
Step 1: finding a new empty Block 2, and copying data from Block 1 except zone A to respective position in Block 2.
Step 2: writing the data segment A ready to be written in zone A of Block 2.
Step 3: erasing Block 1.
In step 1, data from zone B of Block 1 is copied to zone B of Block 2, and data from zone C of Block 1 is copied to zone C of Block 2.
Such method will lead to frequent erasure of the area where system files are located, and bring the problem of low efficiency. Moreover, the wear of the NAND flash is large and it affects the service life of the storage.
According to the above steps and FIG. 1, while updating the data segments with logic address zone A in Block 1 according to the conventional technology, the cost time T without considering the time cost on outside transport port is:T=TR*(M−N)+TW*(M−N)+TW*N+TD;wherein M is the total number of pages in Block 1, N is the number of pages in data segment A, TR is the time cost in reading a page to RAM, TW is the programming time (writing time) from RAM to the page, TD is the time cost in erasing a Block, since TW is far larger than TR, it is approximately considered that:T≈TWM−TWN+TWN+TD=TWM+TD;so the efficiency ratio E of writing data segment A is:E=the time cost in writing data segment A/T=TWN/(TWM+TD);
The smaller the data segment A ready to be updated, the lower the efficiency. The abovementioned FAT table, FDT table, file content data are each a data segment A. By adopting the conventional technology, the operating time is long and the speed of saving files for the system is greatly lowered.
To sum up, the efficiency and speed of reading/writing data is low by using the conventional NAND flash.